<script type="text/javascript">
function story_url(id){
  if(id == 1){
    window.location.href="{:U('Story/index')}";
  }else if(id == 2){
    window.location.href="{:U('Story/culture')}";
  }else if(id == 3){
    window.location.href="{:U('Story/contact')}";
  }
}

function check_form(){
  var bar_1=document.getElementById("bar_1").value;
  var bar_2=document.getElementById("bar_2").value;
  var bar_3=document.getElementById("bar_3").value;
  if(bar_1 == "" || bar_1 == "请输入姓名"){
    $("#story_msg_1").fadeIn("slow");
    return false;
  }
  if(bar_2 == "" || bar_2 == "请输入联系电话"){
    $("#story_msg_1").fadeIn("slow");
    return false;
  }
  if(bar_3 == "" || bar_3 == "请输入您的留言"){
    $("#story_msg_1").fadeIn("slow");
    return false;
  }

  var data = {
    'contact[nickname]': bar_1,
    'contact[tel]': bar_2,
    'contact[content]': bar_3
  };

  $.post('{:U('Story/doContact')}', data, function(data, status) {
    alert(data.info);
    if (true == data.status) {
      return window.location.reload();
    }

    return false;
  });

  return false;
}
</script>
